﻿<div class="umb-listview" ng-controller="UIOMatic.Views.List">

    <div class="umb-sub-header">
        <!--div class="btn-group">
            <a class="btn btn-default" role="button" href="#/{{currentSection}}/uioMaticTree/edit/{{typeName}}">
                <localize key="actions_create" class="ng-isolate-scope ng-scope">Create</localize>
            </a>
        </div-->

        <div class="btn-group" ng-show="isAnythingSelected()">
            <a class="btn btn-danger" ng-disabled="actionInProgress" ng-click="delete()" prevent-default="">
                <localize key="actions_delete">Delete</localize>
            </a>
        </div>

        <!--<form class="form-search pull-right ng-pristine ng-valid" novalidate="">
            <div class="inner-addon left-addon">
                <i class="icon icon-search"></i>
                <input type="text" class="form-control ng-pristine ng-valid" localize="placeholder" placeholder="Type to search..." ng-model="searchFilter" prevent-enter-submit="" no-dirty-check="" ng-change="search(searchFilter)">
            </div>
        </form>-->

    </div>

    <table class="table table-striped">
        <thead>
            <tr>
                <td style="width:35px"></td>
                <td ng-repeat="col in cols">
                    {{col}}
                    <!--<a href="" class="sortable" ng-click="order(col)">{{col}}</a>
                    <i class="icon" ng-class="{'icon-navigation-up': reverse, 'icon-navigation-down': !reverse}" ng-show="predicate == col"></i>-->
                </td>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="row in rows" ng-class="{selected: isRowSelected(row)}">
                <td style="width: 35px">
                    <i class="icon icon-edit"></i>
                    <input type="checkbox" name="selectedItems[]" value="{{getObjectKey(row)}}" ng-checked="isRowSelected(row)" ng-click="toggleSelection(getObjectKey(row))" />
                </td>
                <td ng-repeat="column in cols ">
                    <div ng-switch="isColumnLinkable(column,$index)">
                        <a href="#/{{currentSection}}/uioMaticTree/edit/{{getObjectKey(row)}}%3Ftype={{typeName}}" ng-switch-when="true">{{row[column]}}</a>
                        <span ng-switch-when="false">{{row[column]}}</span>
                    </div>
                </td>
            </tr>
        </tbody>
        <tfoot ng-show="totalPages > 1">
            <tr>
                <th colspan="{{cols.length + 1}}">
                    <div class="pagination pagination-right">
                        <ul>
                            <li ng-class="{disabled: currentPage == 1}">
                                <a href ng-click="prevPage()">Prev</a>
                            </li>
                            <li ng-repeat="i in getNumber(totalPages) track by $index" ng-click="setPage($index+1)" class="active"><span>{{$index+1}}</span></li>
                            <li ng-class="{disabled: currentPage == totalPages}">
                                <a href ng-click="nextPage()">Next</a>
                            </li>
                        </ul>
                    </div>
                </th>
            </tr>
        </tfoot>
    </table>
</div>